<?php
/**
 * Created by PhpStorm
 * User: honglin
 * Date: 2022/9/7
 * Time: 下午5:43
 */

namespace App\Controller\Tasker\Task;

use App\Controller\Tasker\BaseController;
use App\Service\Task\TaskHelpService;
use Hyperf\Di\Annotation\Inject;
use Yj\Apidog\Annotation\ApiController;
use Yj\Apidog\Annotation\FormData;
use Yj\Apidog\Annotation\PostApi;

/**
 * @ApiController(prefix="task/help")
 */
class HelpController extends BaseController
{
    
    /**
     * @Inject()
     * @var TaskHelpService
     */
    protected $taskHelpService;

    /**
     * @PostApi(path="lists")
     */
    public function lists()
    {
        $data = $this->taskHelpService->listsByCategory();
        _SUCCESS($data);
    }

    /**
     * @PostApi(path="detail")
     * @FormData(key="id")
     */
    public function detail()
    {
        $params = $this->getParams();
        $data = $this->taskHelpService->detail($params->get('id'));
        _SUCCESS($data);
    }
}